package com.csh.szhm.utils;

import com.csh.szhm.R;
import com.nineoldandroids.animation.ObjectAnimator;

import android.app.Activity;
import android.view.View;

public class ActivityStartAndFinshAnimation {

	public static void ActivityStartAnimation(Activity activity) {
		activity.overridePendingTransition(R.anim.push_left_in,
				R.anim.push_left_out);
	}

	public static void ActivityFinish(Activity activity) {
		activity.overridePendingTransition(R.anim.push_right_in,
				R.anim.push_right_out);
	}

	/**
	 * 向屏幕下面移动
	 * 
	 * @param view
	 */
	public static void HideAnimation(View view) {

		int hight = view.getHeight();
		ObjectAnimator hideAnimation = ObjectAnimator.ofFloat(view,
				"translationY", hight).setDuration(300);
		hideAnimation.start();
	}

	/**
	 * 从屏幕下面恢复view的位置
	 * 
	 * @param view
	 */
	public static void ShowAnimation(View view) {
		ObjectAnimator hideAnimation = ObjectAnimator.ofFloat(view,
				"translationY", 0).setDuration(300);
		hideAnimation.start();
	}
}
